if exists (select name from sysobjects where name like 'Proc_TyGia_Update')
	drop procedure Proc_TyGia_Update
go

create PROC Proc_TyGia_Update (@matien int,@sec int,@chuyenKhoan int,@ban int,@lastUpdate datetime)
as
	set tran isolation level read committed
	begin tran
		Update TyGia
		set Ban=@ban, ChuyenKhoan=@chuyenKhoan, MaLoaiTien=@matien, LastUpdate=@lastUpdate
		return 1
	rollback
go

------------------------
if exists (select name from sysobjects where name like 'Proc_TyGia_XemTyGia')
	drop procedure Proc_TyGia_XemTyGia
go

create PROC Proc_TyGia_XemTyGia
as
set tran isolation level read committed
begin tran
select lt.TenTien, tg.Sec, tg.ChuyenKhoan, tg.Ban, tg.LastUpdate from TyGia tg, LoaiTien lt where tg.MaLoaiTien = lt.MaLoaiTien
commit tran
go



